﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPrincipal.master" AutoEventWireup="true"
    CodeFile="CadastrarTrilhaAG.aspx.cs" Inherits="Quesito_CadastrarQuesito" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
    <script src="../scripts/json2.js" type="text/javascript"></script>
    <script src="../scripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
    <link href="../Css/geral.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function SomenteNumero(e) {
            var tecla = (window.event) ? event.keyCode : e.which;
            if ((tecla > 47 && tecla < 58)) return true;
            else {
                if (tecla == 8 || tecla == 0) return true;
                else return false;
            }
        }
        function cadastrar() {
            tinyMCE.triggerSave(true, true);
            $.ajax({
                type: "POST",
                url: "CadastrarTrilhaAG.aspx/cadastrar",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                data: JSON.stringify({ titulo: $('#textBoxtitulo').val(), descricao: tinyMCE.get('textBoxDescricao').getContent(), notaInicial: $('#textBoxNotaInicial').val(), notaFinal: $('#textBoxNotaFinal').val(), peso: $('#textBoxPeso').val()}),
                success:
		            function (msg) {
		                window.location = "../Evento/DefaultAG.aspx";
		            }
            });
        };
        function voltar() {
            window.location = "GerenciarMinicursoAG.aspx";
        };
        tinyMCE.execCommand("mceAddControl", true, "textBoxDescricao");
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderConteudo" runat="Server">
    <table>
        <tr>
            <td style="padding-right: 30px;">
                <dl>
                    <dt style="color: Blue; font-size: 15px">MENU</dt>
                    <br />
                    <dd>
                        <a href="\Default.aspx" style="border-bottom: 1px solid #F4F4F4">Principal</a>
                    </dd>
                    <dd>
                        <a href="GerenciarQuesitoAG.aspx" style="border-bottom: 1px solid #F4F4F4">
                            Gerenciar Quesito</a>
                    </dd>
                </dl>
            </td>
            <td style="border-left: 1px solid #EEE; padding-left: 10px">
                <div>
                    <div>
                        <div style="text-align: left">
                            <asp:Label runat="server" ID="LabelQuesitos" Font-Bold="true" Text="Novo Quesito"
                                Font-Size="30px"></asp:Label>
                        </div>
                        <br />
                        <br />
                        <br />
                        <br />
                    </div>
                    <table>
                        <tr>
                            <td style="width: 20%">
                                Título:
                            </td>
                            <td style="width: 80%">
                                <input id="textBoxtitulo" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 20%">
                                Peso:
                            </td>
                            <td style="width: 80%">
                                <input id="textBoxPeso" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 20%">
                                Nota Inicial:
                            </td>
                            <td style="width: 80%">
                                <input id="textBoxNotaInicial" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 20%">
                                Nota Final:
                            </td>
                            <td style="width: 80%">
                                <input id="textBoxNotaFinal" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 20%">
                                Descrição:
                            </td>
                            <td style="width: 80%">
                                <textarea id="textBoxDescricao"></textarea>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <br />
                    <br />
                    <a class="buttonAcao" href="javascript:cadastrarQuesito();">Salvar</a>
            </td>
        </tr>
    </table>
</asp:Content>
